package com.butuh.uang.tuh.ang.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.butuh.uang.tuh.ang.R;
import com.butuh.uang.tuh.ang.model.HomeListBean;
import com.butuh.uang.tuh.ang.util.DecimalFormatUtil;

import org.w3c.dom.Text;

import cn.droidlover.xdroidmvp.base.XListAdapter;

public class ZhaoHuiAdapter extends XListAdapter<HomeListBean> {


    public ZhaoHuiAdapter(Context context) {
        super(context);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHloder viewHloder;
        if (convertView == null) {
            viewHloder = new ViewHloder();
            convertView = LayoutInflater.from(context).inflate(R.layout.item_zhaohui, null);
            viewHloder.iv_product_logo = convertView.findViewById(R.id.iv_product_logo);
            viewHloder.tv_product_name = convertView.findViewById(R.id.tv_product_name);
            convertView.setTag(viewHloder);
        } else {
            viewHloder = (ViewHloder) convertView.getTag();
        }
        HomeListBean bean = data.get(position);
        Glide.with(context).load(bean.getIdentification()).into(viewHloder.iv_product_logo);
        viewHloder.tv_product_name.setText(bean.getDesignation());
        return convertView;
    }


    class ViewHloder {
        ImageView iv_product_logo;
        TextView tv_product_name;
    }

}
